﻿<!--#include file="const.asp"-->
<%
'====================================================================
' 感谢使用晴天3G智能建站系统..
' 作者:梁永强.QQ:766750857
' 官方网址:wap.qt3g.com
' 声明:软件版权归作者所有,没有经过作者本人同意不得非法破解和传播本程序
'====================================================================
%>


<%
if sid="Null" then
	Response.Redirect "login.asp"
	Response.end
end if
IF  Request.QueryString("Action")="login" Then
	call login
else
	call index
end if
end Function



Function index
	dim rs,sql,Runtxt
	Runtxt=qingtian.RunStr
%>
	<card title="常用参数配置"><p align="left">
<a href='index.asp?sid=<%=sid%>'>管理首页</a>&gt;<a href='config.asp?sid=<%=sid%>'>网站配置</a>&gt;配置<br/>
==<b>常用参数配置</b>==<br/>
<%
		set rs=Server.CreateObject("ADODB.Recordset")
		Sql = "select top 1 *  FROM qingtian_config"
		rs.open sql,conn,1,1
		if not (rs.eof and rs.bof) then
                if Request.QueryString("tp")="" then
                 tp=qingtian.FormatEdit(rs("logo"))
                else
                 tp=Request.QueryString("tp")
                 end if
%>
	站点名称：<br/>
	<input emptyok="true"  name="name<%=Runtxt%>" maxlength="50" value="<%=qingtian.FormatEdit(rs("name"))%>" type="text"/><br/>
	站点Logo：<a href='wenjian.asp?url=config1.asp?Action=index&amp;sid=<%=sid%>'>上传</a><br/>
	<input emptyok="true"  name="Logo<%=Runtxt%>" maxlength="255" value="<%=tp%>" type="text"/><br/>
	栏目排序：<br/>
   	<select name="px<%=Runtxt%>" value="<%=qingtian.FormatEdit(rs("px"))%>">
	<%if rs("px")="left" then%>
	<option value="left">向左对齐</option>
	<option value="center">居中对齐</option>
	<option value="right">向右对齐</option>
	<%elseif rs("px")="center" then%>
	<option value="center">居中对齐</option>
	<option value="left">向左对齐</option>
	<option value="right">向右对齐</option>
	<%else%>
	<option value="right">向右对齐</option>
	<option value="left">向左对齐</option>
	<option value="center">居中对齐</option>
	<%end if%>
	</select><br/>
        支付接口商户ID<br/>
        <input emptyok="true"   name="zfpay<%=Runtxt%>" value="<%=rs("zfpay")%>" maxlength="10" type="text"/><br/>
        支付接口商户密匙<br/>
        <input emptyok="true"   name="keyValue<%=Runtxt%>" value="<%=rs("keyValue")%>" maxlength="50" type="text"/><br/>
   	上传组件：<br/>
   	<select name="UploadFileType<%=Runtxt%>" value="<%=rs("UploadFileType")%>" >
	<option value="0">无组件上传</option>
	<option value="1">Aspupload3.0组件</option>
	<option value="2">SA-FileUp 4.0组件</option>
	<option value="999">关闭上传功能</option>
	</select><br/>	
        上传文件格式<br/>
        <input emptyok="true"   name="UploadFileExt<%=Runtxt%>" value="<%=rs("UploadFileExt")%>" maxlength="255" type="text"/>多个格式用","隔开,如gif,jpg<br/>
        上传文件大小<br/>
        <input emptyok="true"   name="UploadFileSize<%=Runtxt%>" value="<%=rs("UploadFileSize")%>" maxlength="255" type="text"/>MB<br/>
   	个人空间是否需要支付才能开通<br/>
   	<select name="kongjian<%=Runtxt%>" value="<%=rs("kongjian")%>" >
	<option value="false">否</option>
	<option value="ture">是</option>
	</select><br/>
        个人空间开通需要支付的<%=rs("bi")%><br/>
        <input format='*N'   name="bishu<%=Runtxt%>" value="<%=rs("bishu")%>" maxlength="50" type="text"/><br/>
	版权信息：<br/>
	<input emptyok="true"  name="copyright<%=Runtxt%>" maxlength="255" value="<%=qingtian.FormatEdit(rs("copyright"))%>" type="text"/><br/>
	<anchor>保存设置
    	<go href="config1.asp?Action=login&amp;sid=<%=sid%>" method='post'>
        <postfield name="name" value="$(name<%=Runtxt%>)"/>
        <postfield name="Logo" value="$(Logo<%=Runtxt%>)"/>
        <postfield name="px" value="$(px<%=Runtxt%>)"/>
        <postfield name="copyright" value="$(copyright<%=Runtxt%>)"/>
        <postfield name="zfpay" value="$(zfpay<%=Runtxt%>)"/>
        <postfield name="keyValue" value="$(keyValue<%=Runtxt%>)"/>
        <postfield name="UploadFileExt" value="$(UploadFileExt<%=Runtxt%>)"/>
        <postfield name="UploadFileType" value="$(UploadFileType<%=Runtxt%>)"/>
        <postfield name="UploadFileSize" value="$(UploadFileSize<%=Runtxt%>)"/>
        <postfield name="kongjian" value="$(kongjian<%=Runtxt%>)"/>
        <postfield name="bishu" value="$(bishu<%=Runtxt%>:n)"/>
    	</go>
	</anchor><br/>
<%
		end if
		rs.Close
		Set rs = Nothing
%>
-------------<br/>
<a href='index.asp?sid=<%=sid%>'>后台管理首页</a><br/>
<%
End Function


Function login

		dim name,Logo,px,copyright,rs,sql,errs,viphy,zfpay,UploadFileExt,UploadFileType,UploadFileSize,keyValue,kongjian,bishu
		name=Request.form("name")
		Logo=Request.form("Logo")
		px=Request.form("px")
		copyright=Request.form("copyright")
		zfpay=TRim(Request.Form("zfpay"))
		keyValue=TRim(Request.Form("keyValue"))
		UploadFileType=TRim(Request.Form("UploadFileType"))
		UploadFileExt=TRim(Request.Form("UploadFileExt"))
		UploadFileSize=TRim(Request.Form("UploadFileSize"))
		kongjian=Request.Form("kongjian")
		bishu=Request.Form("bishu")

		if UploadFileType="" then UploadFileType=10
		if UploadFileSize="" then UploadFileSize=10
		if bishu="" then bishu=0
		if viphy="" then viphy=0
		if zfpay="" then zfpay=0

		errs=""
		if name="" then errs=errs & "站点名称不能为空<br/>"
		if px="" then errs=errs & "栏目排序不能为空<br/>"
		if copyright="" then errs=errs & "版权信息不能为空<br/>"
	%>
	<card id="login" title="常用参数配置" ontimer="index.asp?sid=<%=sid%>"><timer value="20"/>
		<p align="left">
	<%
	IF len(errs)=0 then


		set rs=Server.CreateObject("ADODB.Recordset")
		Sql = "select top 1 * FROM qingtian_config"
		rs.open sql,conn,1,3
		if not (rs.eof and rs.bof) then
			rs("name")=name
			rs("copyright")=copyright
			rs("px")=px
			rs("logo")=logo
			rs("UploadFileExt")=UploadFileExt
			rs("UploadFileType")=UploadFileType
			rs("UploadFileSize")=UploadFileSize
			rs("zfpay")=zfpay
			rs("viphy")=viphy
			rs("keyValue")=keyValue
			rs("kongjian")=kongjian
			rs("bishu")=bishu

			Application(Request.ServerVariables("SERVER_NAME") & "copyright")=copyright
			Application(Request.ServerVariables("SERVER_NAME") & "PX")=px
			Application(Request.ServerVariables("SERVER_NAME") & "Logo")=logo
			Application(Request.ServerVariables("SERVER_NAME") & "name")=name
			Application(Request.ServerVariables("SERVER_NAME") & "kongjian")=kongjian
			Application(Request.ServerVariables("SERVER_NAME") & "bishu")=bishu


		rs.update()
	
		end if
		rs.Close
		Set rs = Nothing
		%>保存设置成功!<br/><%

	else%>
		<%=errs%>
		<a href="config1.asp?sid=<%=sid%>">返回修改</a><br/>
<%	end if
%>
<a href='index.asp?sid=<%=sid%>'>后台管理首页</a><br/>
<%
end Function 


%>
